<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>操作元素</title>
    <style>
    </style>
</head>

<body>
    <div id="root">
        <a href="#">百度</a>
        <a href="#">百度</a>
        <a href="#">百度</a>
        <a href="#">百度</a>
    </div>
    <div>显示当前时间</div>
    <div id="time" style="background-color: palegreen;">你还 是</div>
</body>
<script>
    /* 
    dom修改元素属性
    
    */
    let as = document.getElementsByTagName('a')
    as[2].innerHTML = 'wdeffg'
    as[1].href = 'http://www.baidu.com/'
    document.getElementById("time").innerHTML = Date.now()
    /*
    改变元素内容
        innerHTML 可以识别html元素
            替换了整个标签
        innerText 不识别html标签
            替换文字不包括标签
    */

</script>

</html>